package com.campus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.campus.pojos.domain.ChatMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ChatMessageMapper extends BaseMapper<ChatMessage> {
    @Select("select * from client_chat_message where from_user_id=#{fromUserId} and to_user_id=#{toUserId} order by send_time desc")
    List<ChatMessage> getByFromUserIdAndToUserId(@Param("fromUserId") Integer fromUserId, @Param("toUserId") Integer toUserId);
}
